Metamorphic Programming Structured Recursion for Abstract Data Types
نویسنده
چکیده
We extend the structured recursive programming discipline which favors the use of fold operations in place of general re cursion to abstract data types The key idea is to represent an ADT by two parts a constructor and a destructor which are essentially functions to from a common representation Then a fold can work on an ADT by applying parameter functions to values that are delivered by the ADT s own destructor Fold operations that use as a parameter the constructor of another ADT called ADT transformers play an important role and o er a concise programming style We present some laws for ADT folds and transformers and show their use in program optimization and veri cation
منابع مشابه
Anonymous (co)inductive types: A way for structured recursion to cohabit with modular abstraction
We investigate the interaction between structured recursion combinators and modularization in the style of Standard ML. When built-in structured recursion combinators are straightforwardly added to a language like SML’97 or OCaml, they cannot operate over values of abstractly specified types. Consequently, when a program is modularized in an abstract and fine-grained way, the structured recursi...
متن کاملLinear Time Hierarchies and Functional Languages
y Abstract In STOC 93, Jones sketched the existence of a hierarchy within problems decidable in linear time by a rst-order functional language based on tree-structured data (F), as well as for an extension of that language based on graph-structured data (F su). We consider the Categorical Abstract Machine (CAM), a canonical machine model for implementing higher order functional languages. We sh...
متن کاملStructured recursion for non-uniform data-types
Recursion is a simple but powerful programming technique used extensively in functional languages. For a number of reasons, however, it is often desirable to use structured forms of recursion in programming, encapsulated in so-called recursion operators, in preference to unrestricted recursion. In particular, using recursion operators has proved invaluable for transforming and reasoning about f...
متن کاملObjects Versus Abstract Data Types: Bialgebraically
Algebraic data types and catamorphisms (generic folds) play a central role in functional programming as they allow programmers to define recursive tree-like data structures and operations on them uniformly by structural recursion. Likewise, in object-oriented programming recursive hierarchies of objects play a central role for the same reason, although the execution is quite different. There is...
متن کاملFirst and Second Order Recursion on Abstract Data Types
This paper compares two scheme-based models of computation on abstract many-sorted algebras A: Feferman’s system ACP(A) of “abstract computational procedures” based on a least fixed point operator, and Tucker and Zucker’s system μPR(A) based on primitive recursion on the naturals together with a least number operator. We prove a conjecture of Feferman that (assuming A contains sorts for natural...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008